using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MobileTDL
{
	public partial class ListForm : Form
	{
		private ToDoList _todoList;

		public ListForm()
		{
			InitializeComponent();
		}

		public ToDoList ToDoList
		{
			get { return _todoList; }
			set
			{
				_todoList = value;
				if (_todoList != null) txtProjectName.Text = _todoList.ProjectName;
			}
		}

		private void txtProjectName_GotFocus(object sender, EventArgs e)
		{
			inputPanel1.Enabled = true;
		}

		private void txtProjectName_LostFocus(object sender, EventArgs e)
		{
			inputPanel1.Enabled = false;
		}

		private void miOK_Click(object sender, EventArgs e)
		{
			if (_todoList != null) ToDoList.ProjectName = txtProjectName.Text;
			DialogResult = DialogResult.OK;
		}

		private void miCancel_Click(object sender, EventArgs e)
		{
			DialogResult = DialogResult.Cancel;
		}
	}
}